import { Module } from '@nestjs/common';
import { AppArticleController } from './article.controller';
import { AppArticleService } from './article.service';
import { HttpModule } from '@nestjs/axios';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Article } from './article.entity';
import { PinyinService } from '../ai/pinyin.service';
import { TtsService } from '../ai/tts.service';
import { TranslateService } from '../ai/translate.service';
import { AppGatherService } from '../gather/gather.service';
import { Gather } from '../gather/gather.entity';
import { Collection } from '../collection/collection.entity';
import { History } from '../history/history.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Article, Gather, Collection, History]),
    HttpModule.register({
      timeout: 60000,
      maxRedirects: 5,
    }),
  ],
  controllers: [AppArticleController],
  providers: [
    AppArticleService,
    PinyinService,
    TtsService,
    TranslateService,
    AppGatherService,
  ],
  exports: [AppArticleService],
})
export default class AppArticleModule {}
